package cn.signalpha.modules.base.wrapper;

import cn.signalpha.core.mp.support.BaseEntityWrapper;
import cn.signalpha.core.tool.utils.BeanUtil;
import cn.signalpha.modules.base.entity.Notice;
import cn.signalpha.modules.base.vo.NoticeVO;
import java.util.Objects;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author signalpha
 */
public class NoticeWrapper extends BaseEntityWrapper<Notice, NoticeVO>  {

	public static NoticeWrapper build() {
		return new NoticeWrapper();
 	}

	@Override
	public NoticeVO entityVO(Notice notice) {
		NoticeVO noticeVO = Objects.requireNonNull(BeanUtil.copy(notice, NoticeVO.class));

		//User createUser = UserCache.getUser(notice.getCreateUser());
		//User updateUser = UserCache.getUser(notice.getUpdateUser());
		//noticeVO.setCreateUserName(createUser.getName());
		//noticeVO.setUpdateUserName(updateUser.getName());

		return noticeVO;
	}

}
